package com.jxmcloud.business.cut.feign.vip;


import com.jxmcloud.business.cut.dto.client.CouponParamDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.*;

@FeignClient(value="business-vip-service", path="/", configuration= VipClientNew.VipRemoteClientConfiguration.class, fallbackFactory= VipClientFallbackFactory.class)

public interface VipClientNew {

    class VipRemoteClientConfiguration {
        @Bean
        public VipClientFallbackFactory vipClientFallbackFactory() {
            return new VipClientFallbackFactory();
        }

    }

    /**
     * 查询用户最近购买商品列表
     *
     * @return
     */
    @PostMapping("/app/order/getUserRecentBuyList")
    String getUserRecentBuyList(@RequestParam("loginName") String loginName, @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize,@RequestParam("startTime") String startTime);


    /**
     * 游戏砍一刀发券接口
     * @param couponParamDto {"loginName":"102795072601","orderNo":"GAME20250605002","couponList":[{"couponId":12054,"count":2}]}
     * @return
     */
    @PostMapping("/app/coupon/gameSendCoupon")
    String gameSendCoupon(@RequestBody CouponParamDto couponParamDto);


    /**
     * 查询用户最近购买商品件数
     *
     * @return
     */
    @PostMapping("/app/order/getUserTotalBuyNum")
    String getUserTotalBuyNum(@RequestParam("loginName") String loginName,@RequestParam("startTime") String startTime);

    @PostMapping("/app/pay/getToken")
    String getUserPayToken(@RequestParam("userId") Long userId,@RequestParam("jxbpassword") String jxbpassword);


}
